package com.ezjie.ielts.task;

import java.util.HashMap;
import java.util.Map;

import com.ezjie.ielts.core.http.HttpAPI;
import com.ezjie.ielts.core.http.HttpRequestCallBack;
import com.ezjie.ielts.core.http.ServerInterfaceDefinition;

import android.content.Context;

public class WeixinLoginTask {

	private Context context;

	public WeixinLoginTask(Context context) {
		this.context = context;
	}

	/**
	 * 微信登录
	 * 
	 * @param username
	 * @param password
	 * @param httpRequestCallBack
	 */
	public void doLogin(String assetsToken, String openid,
			HttpRequestCallBack httpRequestCallBack) {
		Map<String, String> params = new HashMap<String, String>();
		params.put("openid", openid);
		params.put("access_token", assetsToken);
		HttpAPI.getInstance(context,true).doPostRequest(
				ServerInterfaceDefinition.WEIXINLOGIN_PATH, params, httpRequestCallBack);
	}

}
